POV-Ray : Newsgroups : povray.beta-test : Can't undefine defined entry of array : Re: Can't undefine defined entry of array Server Time
30 Jul 2024 02:13:50 EDT (-0400)
  Re: Can't undefine defined entry of array  
From:
Date: 22 Jan 2002 06:37:23
Message: <ediq4ukcihbillqkpjjtsh051m2nb4o2lf@4ax.com>
On Tue, 22 Jan 2002 12:12:57 +0100, "Thorsten Froehlich" <tho### [at] trfde>
wrote:
> > Since checking of defined pointer is possible for entries of array then
> > undefinig should be possible also.
>
> No, it shouldn't.  What would the suggested change do?  Resize the array?

Documentation says: "Large uninitialized arrays do not take much memory.
Internally they are arrays of pointers so they probably use just 4 bytes per
element. Once initialized with values, they consume memory depending on what you
put in them."

So when I want undef entry it means imo: free memory pointed by this entry and
write NULL (or eqivalent) into this pointer/entry.

> You can
> undef the array, which is exactly what you are supposed to be able to do.

If it is really feature request then sorry but I think it is large wasting of
memory in this case. Imagine large array of points. For some reason to determine
important points I have to calculate them all. But when they calculated I don't
need not important points so I want undef part of entries fo save memory for
next purposes. All workarounds with external file or rewriting array slows
parsing a lot. But if it is really feature request then sorry again.

> It has never been stated that you can undef array elements.

6.2.2.4 says: "You may however un-define an identifier using the #undef
directive." So what is identifier ? 6.2.2.1 answers imo that identifier is
everything what can be declared. Entry of array can be declared and can be
tested via ifdef(), ifndef(), defined().

ABX


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.